﻿using HalconDotNet;
using NDK.Module.BLL;
using NPOI.SS.Formula.Functions;
using System.Collections.Generic;

namespace NDK.Module.Model
{
    public class DataItem
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public double Value { get; set; }
        public int Position { get; set; }
        public string JugeResult { get; set; }
        public int Remark { get; set; }
    }

    public enum batteryType
    {
        Bottom = 0,
        PostBottom = 1,
        Book = 2,
        PostBook = 3
    }
    public class Battery : MeasureProduct
    {
        public int R1TurnNo { get; set; }
        public int R2TurnNo { get; set; }

        public int NotchPlug { get; set; }//0:没贴NotchPlug，1：贴了NotchPlug

        private List<DataItem> _measureData = new List<DataItem>();

        public Battery() : base()
        {
            _measureData = new List<DataItem>();
        }
    }

    public class MeasureProduct
    {
        public string SN { get; set; }
        public int TYPE { get; set; }
        public string NG_FAI { get; set; }
        public string OK_NG { get; set; }
        public string Position { get; set; }
        public string MesInfo { get; set; }

        public HImage SideCam_1 { get; set; }
        public HImage SideCam_2 { get; set; }

        public HImage SideLaser_长边1 { get; set; }
        public HImage SideLaser_长边2 { get; set; }
        public HImage UpLaser { get; set; }
        public HImage DownLaser1 { get; set; }

        public HImage SideLaser_短边1 { get; set; }
        public HImage SideLaser_短边2 { get; set; }

        public HImage UpCamImage_1 { get; set; }
        public HImage UpCamImage_2 { get; set; }
        public HImage UpCamImage_3 { get; set; }
        public HImage UpCamImage_4 { get; set; }

        public JUDGEMENT_RESULT Result { get; set; }

        public int ProductID { get; set; }

        public int whichBlock { get; set; }

        private List<DataItem> _measureData = new List<DataItem>();

        public List<DataItem> MeasureData
        {
            get { return _measureData; }
            set { _measureData = value; }
        }

        public MeasureProduct()
        {
            TYPE = 0;
            SN = "";
            NG_FAI = "";
            Position = "";
            whichBlock = -1;
            _measureData = new List<DataItem>();
            ProductID = 0;
            SideCam_1 = new HImage();
            SideCam_2 = new HImage();

            SideLaser_长边1 = new HImage();
            SideLaser_长边2 = new HImage();
            UpLaser = new HImage();

            SideLaser_短边1 = new HImage();
            SideLaser_短边2 = new HImage();

            UpCamImage_1 = new HImage();
            UpCamImage_2 = new HImage();
            UpCamImage_3 = new HImage();
            UpCamImage_4 = new HImage();

            DownLaser1 = new HImage();

            Result = JUDGEMENT_RESULT.OK;
        }
    }
}
